/*
 * @Description:
 * @Author: r_yuesheng
 * @Date: 2021-07-08 15:47:50
 * @LastEditTime: 2021-07-08 19:39:29
 * @LastEditors: r_yuesheng
 */
import React from 'react';
import { Spin } from 'antd';
import Loadable from 'react-loadable';

// 加载动画
const loadingComponent = () => {
  return (
    <div className={'spin-loading'}>
      <div>
        <Spin size="large" />
      </div>
    </div>
  );
};
// 当不传加载动画时候使用默认的加载动画
const loader = (loader, loading = loadingComponent) => {
  return Loadable({
    loader,
    loading
  });
};

export default loader;
